{% extends "base_petadmin.html" %}

{% block mainheading %}{{ block.super }} \ Deviations list{% endblock %}

{% block object-tools %}
	<ul class="object-tools">
		<li><a href="/pet/deviations/import/">Import file</a></li>
	</ul>
{% endblock %}

{% block content %}

    <table>
        <tr>
            <th>Date</th>
            <th>Market</th>
            <th>Category</th>
            <th>Initiator</th>
            <th>P/L / 1000</th>
            <th>Note</th>
            <th></th>
        </tr>
    {% for item in object_list %}
        <tr>
            <td>{{ item.date|date:"Y-m-d" }}</td>
            <td>{{ item.market_id.name }}</td>
            <td>{{ item.category }}</td>
            <td>{{ item.initiator }}</td>
            <td>{{ item.pl_100 }}</td>
            <td>{{ item.note }}</td>
            <td>
                <a href="/pet/deviation/{{ item.pk }}/" class="changelink"> </a>
                <a href="/pet/deviation/{{ item.pk }}/delete/" class="deletelink"> </a>
            </td>
        </tr>
    {% empty %}
        <tr>
            <td colspan="7">No records</td>
        </tr>
    {% endfor %}

        <tr>
            <td colspan="7"><input type="button" value="Add new" onclick="window.location.href='/pet/deviation/add/'" /></td>
        </tr>
    
    </table>

{% endblock %}
